﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" type="text/css" href="/bzbs/css/style.css" />

<link rel="stylesheet" type="text/css" href="/bzbs/manager/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/bzbs/manager/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/bzbs/manager/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/bzbs/manager/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/bzbs/manager/static/h-ui.admin/css/style.css" />
<title>商品列表</title>
</head>
<body>
<font color="red"> <c:choose>
			<c:when test="${msg=='addSuccess'}">添加成功</c:when>
			<c:when test="${msg=='addError'}">添加失败</c:when>
			<c:otherwise></c:otherwise>
		</c:choose>
	</font>
	<font color="red"> <c:choose>
			<c:when test="${info=='addSuccess'}">修改成功</c:when>
			<c:when test="${info=='addError'}">修改失败</c:when>
			<c:otherwise></c:otherwise>
		</c:choose>
	</font>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a class="btn btn-primary radius"  href="<%=path%>/manager/commodity_add.jsp"><i class="Hui-iconfont">&#xe600;</i> 添加商品</a></span>  </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				<tr class="text-c">
					<th width="80">ID</th>
					<th width="100" >商品名称</th>
					<th width="100">商品图片</th>
					<th width="100">商品价格</th>
					<th width="120">商品类型</th>
					<th width="90">联系方式</th>
					<th width="200">详情介绍</th>
					<th width="120">操作</th>
				</tr>
			</thead>
			<tbody >
			<c:forEach items="${pageInfo.list}" var="commodity">
				<tr class="text-c">
					<td>${commodity.commId}</td>
					<td>${commodity.commName}</td>
					<td class="text-c"><img id="imgName" width="100" class="picture-thumb" src="<%=path%>/shoponline/img/${commodity.imgName}" alt="无照片显示"></td>
					<td>${commodity.price}</td>
					<td>${commodity.type}</td>
					<td>${commodity.contact}</td>
					<td>${commodity.detail}</td>
					<td>
					<a href="<%=path%>/commodity/manager/queryone.do?commId=${commodity.commId}"class="btn btn-secondary radius size-MINI">修改</a>
					<a href="<%=path%>/commodity/manager/delete.do?commId=${commodity.commId}"class="btn btn-secondary radius size-MINI">删除</a>
					</td>
				</tr>
				</c:forEach>
				
			</tbody>
		</table>
		  <div class="pagin">
    	<div class="message"><%-- 共<i class="blue">${pageInfo.total}</i>条记录， --%>
    	                                                    共<i class="blue">${pageInfo.pages }</i>页&nbsp;当前显示第&nbsp;<i class="blue">${pageInfo.pageNum }&nbsp;</i>页
    		&nbsp;&nbsp;&nbsp;每页条数：
    		<select id="selectSize" onchange="changeSize()">
    			<option ${pageInfo.pageSize==1?'selected':'' }>1</option>
    			<option ${pageInfo.pageSize==3?'selected':'' }>3</option>
    			<option ${pageInfo.pageSize==5?'selected':'' }>5</option>
    			<option ${pageInfo.pageSize==8?'selected':'' }>8</option>
    		</select>                                                    
 	    </div>
        <ul class="paginList">
	        
	         <li class="paginItem"><a href="<%=path%>/commodity/query.do?pageNum=1&pageSize=${pageInfo.pageSize }">首页</a></li>
	         <li class="paginItem"><a href="<%=path%>/commodity/query.do?pageNum=${pageInfo.pageNum-1 }&pageSize=${pageInfo.pageSize }">上一页</a></li>
	         <%-- <c:forEach begin="1" end="${pageInfo.pages }" var="i">
	         	 <li class="paginItem">
	         	 	<a  href="<%=path%>/illegal/myIllegal.do?personId=${sessionScope.user.id}&pageNum=${i }&pageSize=${pageInfo.pageSize }">
	         	 		<font ${pageInfo.pageNum==i?'color="red"':'' }>${i }</font>
	         	 	</a>
	         	 </li>
	         </c:forEach> --%>
	         <li class="paginItem"><a href="<%=path%>/commodity/query.do?pageNum=${pageInfo.pageNum+1 }&pageSize=${pageInfo.pageSize }">下一页</a></li>
	         <li class="paginItem"><a href="<%=path%>/commodity/query.do?pageNum=${pageInfo.pages }&pageSize=${pageInfo.pageSize }">尾页</a></li>
        </ul>
    </div>
    </div>
</div>

</body>
</html>